import http from '@/utils/fetch'

/**
 * 账单结算
 */
// 结算审核列表
export function auditSettleList(params) {
  return http.post('/Admin/FinanceCheck/orderLeaseSettleList', params)
}
// 获取结算详情
export function getSettleData(id) {
  return http.get('/Admin/FinanceCheck/getSettleData', { lease_id: id })
}
// 拒绝结算
export function orderRefuseSettle(params) {
  return http.post('/Admin/FinanceCheck/orderRefuseSettle', params, true)
}
// 异常订单更新颜色
export function updateColor({orderId_Json,color}) {
  return http.post('/Admin/OrderError/updateColor', { orderId_Json,color },true)
}
// 撤销拒绝结算
export function cancelRefuseSettle(id) {
  return http.post(
    '/Admin/FinanceCheck/cancelRefuseSettle',
    { lease_id: id },
    true
  )
}
// 账单结算--单期结算
export function orderSettle(id) {
  return http.post('/Admin/FinanceCheck/orderSettle', { lease_id: id }, true)
}

/**
 * 花呗账单
 */
// 花呗订单结算列表
export function huebeiSettleList(params) {
  return http.post('/Admin/FinanceCheck/huebeiOrderSettleList', params)
}
// 获取花呗结算详情
export function getHuabeiSettleData(id) {
  return http.get('/Admin/FinanceCheck/getHuabeiOrderSettleData', {
    order_id: id
  })
}
// 花呗订单结算
export function huabeiOrderSettle(id) {
  return http.post(
    '/Admin/FinanceCheck/huabeiOrderSettle',
    { order_id: id },
    true
  )
}
// 花呗订单拒绝结算
export function huabeiRefuseSettle(params) {
  return http.post('/Admin/FinanceCheck/huabeiOrderRefuseSettle', params, true)
}
// 花呗订单撤销拒绝结算
export function huabeiCancelRefuseSettle(id) {
  return http.post(
    '/Admin/FinanceCheck/huabeiCancelRefuseSettle',
    { order_id: id },
    true
  )
}

// 订单退款审核列表
export function orderRefundCheckList(params) {
  return http.post('/Admin/FinanceCheck/orderRefundCheckList', params)
}

// 筛选获取所有订单状态
export function getOrderStatus() {
  return http.post('/Admin/Finance/getOrderStatus')
}
// 财务订单列表
export function financeOrderList(params) {
  return http.post('/Admin/Finance/financeOrderList', params)
}
// 财务逾期列表
export function financeOverdueList(params) {
  return http.post('/Admin/Finance/financeOverdueList', params)
}
// 提现记录
export function withdrawalList(params) {
  return http.post('/Admin/Withdrawal/withdrawalList', params)
}
// 财务对账流水
export function reconciliationFlow(params) {
  return http.post('/Admin/Finance/reconciliationFlow', params)
}
// 用户提现记录
export function userWithdrawalList(params) {
  return http.post('/Admin/Withdrawal/userWithdrawalList', params)
}
// 获取手续费率和手续费详情
export function getFeeDetails(params) {
  return http.post('/Admin/Finance/getFeeDetails', params)
}
// 账单财务列表
export function financeLeaseList(params) {
  return http.post('/Admin/Finance/financeLeaseList', params)
}
// 获取记录流水
export function getLeaseFlow(params) {
  return http.post('/Admin/Finance/getLeaseFlow', params)
}
// 财务订单导出
export function orderListExport(params) {
  return http.export('/Admin/Finance/orderListExport', params, '订单财务列表')
}
// 财务租期列表导出
export function leaseListExport(params) {
  return http.export('/Admin/Finance/leaseListExport', params, '账单财务列表')
}
// 财务逾期列表导出
export function overdueListExport(params) {
  return http.export('/Admin/Finance/overdueListExport', params, '逾期列表')
}
// 财务对账流水导出
export function reconciliationExport(params) {
  return http.export('/Admin/Finance/reconciliationExport', params, '对账流水')
}
// 手动代扣
export function manualWithholding(params) {
  return http.post('/Admin/Finance/manualWithholding', params, true)
}
// 逾期列表-客服备注记录
export function getOrderRemark(params) {
  return http.post('/Admin/Finance/getOrderRemark', params)
}
// 逾期列表-短信发送记录
export function getOverdueSmsLog(leaseId) {
  return http.post('/Admin/Finance/getOverdueSmsLog', { leaseId })
}
// 逾期列表-逾期短信批量发送
export function sendOverdueSms(leaseId) {
  return http.post('/Admin/Finance/sendOverdueSms', { leaseId })
}
// 添加客服备注
export function setOrderRemark(params) {
  return http.post('/Admin/Finance/setOrderRemark', params, true)
}
// 查看扣款记录
export function leaseWithholdLog(params) {
  return http.post('/Admin/Finance/leaseWithholdLog', params)
}
// 提现记录导出
export function withdrawalListExport(params) {
  return http.export(
    '/Admin/Withdrawal/withdrawalListExport',
    params,
    '提现记录'
  )
}
// 花呗财务账单列表
export function financeHuaBeiList(params) {
  return http.post('/Admin/Finance/financeHuaBeiList', params)
}
// 花呗财务账单列表-导出
export function huaBeiListExport(params) {
  return http.export(
    '/Admin/Finance/huaBeiListExport',
    params,
    '花呗财务账单列表'
  )
}
// 设备分期列表
export function financeEquipmentList(params) {
  return http.post('/Admin/Finance/financeEquipmentList', params)
}
// 设备分期列表-导出
export function equipmentListExport(params) {
  return http.export(
    '/Admin/Finance/equipmentListExport',
    params,
    '设备分期列表'
  )
}
// 回款列表
export function financeCollectionList(params) {
  return http.post('/Admin/Finance/financeCollectionList', params)
}
// 回款列表-导出
export function collectionListExport(params) {
  return http.export('/Admin/Finance/collectionListExport', params, '回款列表')
}
// 账单结算列表导出
export function orderLeaseSettleExport(params) {
  return http.export(
    '/Admin/FinanceCheck/orderLeaseSettleExport',
    params,
    '账单结算列表'
  )
}
// 花呗订单结算列表导出
export function huebeiExport(params) {
  return http.export(
    '/Admin/FinanceCheck/huebeiOrderSettleExport',
    params,
    '花呗订单结算列表'
  )
}
// 自动代扣开关操作
export function withholdSwitch(params) {
  return http.post('/Admin/Finance/withholdSwitch', params, true)
}
// 获取修改账单为线下支付订单信息
export function getOfflinePayData(oId, lId) {
  return http.get('/Admin/Finance/getOfflinePayData', { order_id: oId, lease_id: lId })
}
// 线下支付发送验证码
export function offlinePaySendCode(oId, lId) {
  return http.post('/Admin/Finance/offlinePaySendCode', { order_id: oId, lease_id: lId }, true)
}
// 修改账单为线下支付
export function setOfflinePay(params) {
  return http.post('/Admin/Finance/setOfflinePay', params, true)
}
// 获取订单操作记录
export function getOrderLog(params) {
  return http.get('/Admin/Finance/getOrderLog', params)
}

// 手动代扣_余款
export function manualWithholding_1(params) {
  return http.post('/Admin/Finance/manualWithholding1', params, true)
}

// 手动代扣_销帐
export function manualWithholding_XZ(params) {
  return http.post('/Admin/Finance/manualWithholding_XZ', params, true)
}
// 账单日列表
export function accountantDayList(params) {
  return http.post('/Admin/Finance/accountantDayList', params)
}
//异常列表
export function orderErrorList(params) {
  return http.post('/Admin/OrderError/orderErrorList', params)
}
//移至已还款列表
export function sureOrderRepayment(params) {
  return http.post('/Admin/OrderError/sureOrderRepayment', params)
}

//已还款列表
export function orderRepaymentList(params) {
  return http.post('/Admin/OrderError/orderRepaymentList', params)
}

//取消移交
export function updateHandOver(orderId) {
  return http.post('/Admin/OrderError/updateHandOver', orderId)
}